#include "XRectangle.h"

XRectangle::XRectangle(XPoint *p1, XPoint *p2)
{		
	if( p1->LessThan(p2) )
	{
		leftBottom = new XPoint(p1);
		rightTop = new XPoint(p2);
	}
	else
	{
		leftBottom = new XPoint(p2);
		rightTop = new XPoint(p1);
	}
}

XRectangle::XRectangle(const XRectangle &rect)
{		
	leftBottom = new XPoint(rect.GetLeftBottom());
	rightTop = new XPoint(rect.GetRightTop());
}

XPoint *XRectangle::GetLeftBottom() const
{
	return leftBottom;
}

XPoint *XRectangle::GetRightTop() const
{
	return rightTop;
}

void XRectangle::Draw()
{
}
		
void XRectangle::MoveBy(double x, double y, double z) 
{
	leftBottom->MoveBy(x, y, z);
	rightTop->MoveBy(x, y, z);
}

void XRectangle::MoveBy(XPoint *XPoint)
{
	leftBottom->MoveBy(XPoint);
	rightTop->MoveBy(XPoint);
}

void XRectangle::Rotate(XPoint *rotationOrigin, double angle, int axis)
{
	leftBottom->Rotate(rotationOrigin, angle, axis);
	rightTop->Rotate(rotationOrigin, angle, axis);
}

void XRectangle::Scale(XPoint *scaleOrigin, double scaleFactor)
{
	leftBottom->Scale(scaleOrigin, scaleFactor);
	rightTop->Scale(scaleOrigin, scaleFactor);
}

void XRectangle::Shear(double angle) 
{
}

void XRectangle::Stretch(XPoint *from, XPoint *to)
{
}
